package iooperator;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * @Filename: CharacterOperation
 * @Author: czh
 * @Data:2023/7/4 10:44
 * 字符操作(Reader、riter)
 */
public class CharacterOperation {
    public static void main(String[] args) {
        printTextLine();
    }

    public static void printTextLine() {
        String src = "D:\\workspace\\java\\src\\iooperator\\服务器账号密码.txt";
        BufferedReader bufferedReader = null;
        try {
            FileReader fileReader = new FileReader(src);
            bufferedReader = new BufferedReader(fileReader);
            // 按行读取文件
            String line;
            while ((line = bufferedReader.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                bufferedReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
